<!DOCTYPE html>
<html style="display: block;height:100%;">
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/2022data.js"></script>
		<script src="js/2023data.js"></script>
		
	</head>
	<body style="display: block;height:100%;" onload="init()">
		<table style="width:100%;" id="content">
			<tr><td>名字</td><td>日期</td><td>摘要</td><td>价格</td><td>手数</td><td>总价</td></tr>
	       <tr v-for="item in list">
			   <td>{{item.stkname}}</td>
			   <td>{{item.bizdate}}</td>
			   <td>{{item.summary}}</td>
			   <td style="text-align: right;;">{{item.matchprice}}</td>
			   <td style="text-align: right;;">{{item.matchqty}}</td>
			   <td style="text-align: right;;">{{item.matchamt}}</td>
			   
		   </tr>
		   <tr>
			   <td>总：</td><td colspan=5 style="    text-align: right;">{{total}}</td>
		   </tr>
		</table>
	</body>
</html>
	<script src="js/vue.min.js"></script>
<script>
	function init(){
		let name=	 location.href.split("=")[1];
		name = decodeURI(name);
		let list = [];
		let total = 0;
		let allData = data2022.concat(data2023);
		allData.map(item=>{
			if(item.stkname==name){
				list.push(item);
				total+=parseFloat(item.bsflag=="B"?item.matchamt:-item.matchamt);
				
			}
		});
		
		app = new Vue({
			el: "#content",
		
			data: function() {
				return {
					list:list,
					total:total
				}
				},
				});
	}
</script>
